package player

import (
	"GameServer/Common/utils"
	"GameServer/Game/lib"
	"GameServer/Game/sp"

	"fmt"
)

func (p *Player) GetStaticRequest(req *sp.GetStaticRequest) (res *sp.GetStaticResponse) {

	cc := p.User.GetCardGame()
	var killMonNum int64 = 0

	for _, item := range cc.KillMonsters {
		killMonNum += item.KillNum
	}

	fmt.Printf("GetStaticRequest time:%s  cc: %s  killMonNum: %d \n\n", utils.TimeToLayout(utils.TNow()), utils.Obj2JsonStr(cc), killMonNum)

	resStatics := lib.FormatBaseStaticSps(p.User.GetUserStatic().Statics)

	resStatics = append(resStatics, &sp.BaseStatic{
		Typ: 3,
		Num: killMonNum,
	})

	res = &sp.GetStaticResponse{
		BaseStatics:    resStatics,
		FireGridRate:   p.User.FireGridRate,
		HandleGoldRate: p.User.HandleGoldRate,
		TheftGoldRate:  p.User.TheftGoldRate,
		PetSelectTid:   p.User.GetUserPet().SelectTid,
	}
	return
}
